#if !defined(AFX_EDITORTABVIEW_H__FEE9A4B2_79C1_45DC_8DDF_DDE230211C65__INCLUDED_)
#define AFX_EDITORTABVIEW_H__FEE9A4B2_79C1_45DC_8DDF_DDE230211C65__INCLUDED_

#pragma once

#include "CHTabView.h"
#include "CHTreeCtrl.h"

class CEditorTabView : public CHTabView
{
protected:
	CEditorTabView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CEditorTabView)
	virtual ~CEditorTabView();

public:
	void CloseAllFile();
	void CloseFile(PNODEINFO pNode);
	void ResetItem(int nIndex = -1);
	void ShowFile(PNODEINFO pNode);
	void LoadFontSetting();
	void RefreshEditorFont();
	void OnEditClose(BOOL bAll);
	void OnEditSave(BOOL bAll);
	void OnEditReadonly();
	BOOL OnUpdateEditClose(BOOL bAll);
	BOOL OnUpdateEditSave(BOOL bAll);
	int OnUpdateEditReadonly();

protected:
	int GetItemCount() const
	{
		return GetTabCtrl().GetItemCount();
	}
	int GetCurSel() const
	{
		return GetTabCtrl().GetCurSel();
	}

	DWORD GetItemData(int nItem)
	{
		ASSERT(nItem >= 0 && nItem < GetItemCount());

		TCITEM tci;
		tci.mask = TCIF_PARAM;
		GetTabCtrl().GetItem(nItem, &tci);
		return (DWORD) tci.lParam;
	}
	void SetItemData(int nItem, DWORD dwData)
	{
		ASSERT(nItem >= 0 && nItem < GetItemCount());

		TCITEM tci;
		tci.mask = TCIF_PARAM;
		tci.lParam = dwData;
		GetTabCtrl().SetItem(nItem, &tci);
	}

protected:
	LOGFONT	m_lf;
	CFont	m_font;


protected:
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEditorTabView)
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	//}}AFX_VIRTUAL

	//{{AFX_MSG(CEditorTabView)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	//}}AFX_MSG
	afx_msg LRESULT OnActivateView(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_EDITORTABVIEW_H__FEE9A4B2_79C1_45DC_8DDF_DDE230211C65__INCLUDED_)
